package com.healthbox.appointmentservice.service.impl;

import com.healthbox.appointmentservice.common.InfoMessage;
import com.healthbox.appointmentservice.common.SendMQMessage;
import com.healthbox.appointmentservice.service.MessageSender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author pengpeng
 * @date 2022/5/22
 */
@Service
@Slf4j
public class MessageSenderAdapterMQ  implements MessageSender {
    @Autowired
    private SendMQMessage messageSender;
    @Override
    public void sendMessage(InfoMessage message) {
        log.info("send message to rabbitMQ: " + message);
        messageSender.send(message);
    }
}
